/**
 * 用户列表相关接口
 */
import request from '@/utils/request.js'

/**
 * 查询分页
 */
export const getList = () => {
  return request({
    url: '/system/menu/list',
    method: 'GET',
  })
}

/**
* 获取详情数据
*/
export const getNotice = (id) => {
  return request({
    url: `/system/menu/${id}`,
    method: 'GET',
  })
}

/**
 * 获取菜单选择树
 */
export const treeselect = () => {
  return request({
    url: `/menu/treeselect`,
    method: 'GET',
  })
}

/**
* 添加数据
*/
export const add = (row) => {
  return request({
    url: '/system/menu',
    method: 'POST',
    data: row,
  })
}

/**
 * 修改
 */
export const update = (row) => {
  return request({
    url: '/system/menu',
    method: 'PUT',
    data: row,
  })
}

/**
 * 删除菜单
 */
export const remove = (id) => {
  return request({
    url: `/system/menu/${id}`,
    method: 'DELETE',
  })
}


// 获取当前用户的路由权限
export const getRouters = () => {
  return request({
    url: '/system/menu/getRouters',
    method: 'GET',
  })
}